import axios from '../../util/http'
import * as api from '../../util/api'
const state ={
        deliveryOrderNumber:100,
        deliveryGoodsNumber:100,
        deliveryAmount:100,
    orderDetailsList:[{
        orderMainId: '000001',
        goodsName:'黑人牙膏',
        deliveryTime: '2020-03-12',
        goodsNumber:'10笔',
        deliveryNumber:'8笔',
        deliveryAmount:'￥21.00元',
    },
        {
            orderMainId: '000001',
            goodsName:'黑人牙膏',
            deliveryTime: '2020-03-12',
            goodsNumber:'10笔',
            deliveryNumber:'8笔',
            deliveryAmount:'￥21.00元',
        }]
};
const mutations ={
    selectDeliveryData(state,obj){
        state.orderDetailsList=obj.orderDetailsList
        state.deliveryOrderNumber=obj.deliveryOrderNumber
        state.deliveryGoodsNumber=obj.deliveryGoodsNumber
        state.deliveryAmount=obj.deliveryAmount
      /*  state.orderDetailsList = obj.orderDetailsList*/
    },

};
const actions={
    getDeloveryStatisticData({commit},obj){
        return axios({
            url:api.shipmentStatistics,
            method:'post',
            data:obj
        }).then(res=>{
            console.log(11123)
            console.log(res)
            commit('selectDeliveryData',res.data)
            return res.code

        })
    }
};
const getters ={

};
export default{
    state,
    actions,
    mutations,
    getters
}